<?php

namespace App\Model;


use Laravel\Passport\HasApiTokens;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
class AdminUser extends Authenticatable
{
    use Notifiable,HasApiTokens;
    /**
     * 关联表名
     * @var stringw
     */
    protected $table = 'admin_user';

    /**
     * 表明模型是否应该被打上时间戳
     * @var bool
     */
    public $timestamps = false;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name', 'email', 'password',
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password', 'remember_token',
    ];


    // 通过 phone 查找没有在禁用状态下的用户：
    public function findForPassport($username)
    {
        return \App\User::where('email', $username)->first();
    }
}
